/* Ethernet ENC28J60 public interface */

/* Copyright (C) 2009 David Zanetti
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#define ENC28J60_H

/* perform init */
void enc28j60_init(void);

/* send the packet pointed at by pkt, of length len */
uint8_t enc28j60_tx(void *pkt, uint16_t len);

/* read the entire next packet into a buffer */
uint16_t enc28j60_rx(uint8_t *pkt, uint16_t maxlen);

void enc28j60_hardreset(void);
void enc28j60_softreset(void);

/* process an interrupt */
void enc28j60_interrupt(void);

